using Shared.Domain.Shared.Enums.UserService;
using SqlSugar;
using Volo.Abp.Auditing;
using Volo.Abp.Domain.Entities;

namespace UserService.Domain.Entities;

/// <summary>
/// 好友请求实体 - 处理好友申请流程
/// </summary>
[SugarTable("FriendshipRequests")]
public class FriendshipRequest : Entity<Guid>, IHasCreationTime
{
    /// <summary>
    /// 请求唯一标识
    /// </summary>
    [SugarColumn(IsPrimaryKey = true, IsIdentity = false)]
    public override Guid Id { get; protected set; }

    /// <summary>
    /// 发送请求用户ID
    /// </summary>
    [SugarColumn(IsNullable = false)]
    public Guid SenderUserId { get; set; }

    /// <summary>
    /// 接收请求用户ID
    /// </summary>
    [SugarColumn(IsNullable = false)]
    public Guid ReceiverUserId { get; set; }

    /// <summary>
    /// 请求消息
    /// </summary>
    [SugarColumn(Length = 200, IsNullable = true)]
    public string Message { get; set; }

    /// <summary>
    /// 请求状态
    /// </summary>
    [SugarColumn(IsNullable = false)]
    public FriendRequestStatus Status { get; set; } = FriendRequestStatus.Pending;

    /// <summary>
    /// 创建时间
    /// </summary>
    [SugarColumn(IsNullable = false)]
    public DateTime CreationTime { get; set; } = DateTime.Now;

    /// <summary>
    /// 处理时间
    /// </summary>
    [SugarColumn(IsNullable = true)]
    public DateTime? ProcessTime { get; set; }
}